package socket

import (
	"card/app/framework/common"
	"card/app/framework/proto"
)

var games = map[string]string{
	"lord": "lord",
}

type Handler map[string]common.Igame

var Handlers Handler

func Register(gameType string) Handler {
	if Handlers == nil {
		Handlers = make(Handler)
	}
	if _, ok := Handlers[gameType]; !ok {
		Handlers[gameType] = NewGame(gameType, proto.GameList[gameType])
	}
	return Handlers
}
